package FirstExam10tasks;

import java.util.Scanner;

public class Task2 {

	public static void main(String[] args) 
	{
		Scanner sc = new Scanner(System.in);
		
		System.out.println("Enter the number to chech if its palindrom!");
		String number = sc.nextLine();
		
		int length = number.length() / 2;
		int rightInd = number.length()-1;
		boolean flag = true;
		
		for(int i = 0; i < length; i++)
		{
			int left = number.charAt(i);
			int right = number.charAt(rightInd);
			rightInd--;
			
			if(left != right)
			{
				flag = false;
			}

		}
		
		System.out.println("The number is palindrome!? " + flag);
		
	}

}
